package top.wenzz.commons.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

/**
 * Created by 钟廷员 on 2016/12/23.
 */
@Data
public class PageRequest {
    private int current;// 页面页数从1开始，spring data jpa从0开始
    private int pageSize;
    private long total;
    @JsonIgnore
    private Sort sort;

    public PageRequest() {
        this.current = 1;
        this.pageSize = 10;
    }

    public org.springframework.data.domain.PageRequest init() {
        return new org.springframework.data.domain.PageRequest(this.current - 1, this.pageSize, sort);
    }
}
